package com.yb.nowcoder;

import java.util.Scanner;

/**
 * 华为机试练习第5题
 */
public class Main12 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()) {
            String s = in.nextLine();
            s = s.trim();
            String[] arr = s.split("[^a-zA-Z]+");
            for (int i = arr.length - 1; i >= 2; i--) {
                System.out.print(arr[i] + " ");
            }
            if (!"".equals(arr[0])) {
                System.out.print(arr[1] + " " + arr[0]);
            } else {
                System.out.print(arr[1]);
            }
        }
    }
}
